// 下载跨域文件
const downloadCors = (resBlob: Blob, filename: string) => {
  const newUrl = window.URL.createObjectURL(resBlob);
  const a = document.createElement('a');
  a.setAttribute('href', newUrl);
  a.setAttribute('target', '_blank');
  a.setAttribute('download', filename);
  document.body.appendChild(a);
  a.click();
  document.body.removeChild(a);
};

export default downloadCors;
